#pragma once

namespace otp
{
  static inline int OtpCheck(int value, const char *msg = NULL, int expect = OTPA_OK)
  {
    if(value != expect)
      throw auth::CAuthException(value, (msg ? msg : "Failed to call OTP API."));

    return value;
  }
} // namespace otp
